/*
 * #%L
 * InterfaceAPI
 * %%
 * Copyright (C) 2011 Ractoc.com
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package com.ractoc.opengamefinder.api.vo;

import com.jme3.network.serializing.Serializable;

/**
 * Value object containing the actual player account data.
 * @author ractoc
 * @version 0.1
 */
@Serializable
public final class AccountVO {
    private Integer id;
    private String name;
    private AvatarVO avatar;
    
    /**
     * Default constructor.
     */
    public AccountVO() {
    }

    /**
     * Return the supplied account id.
     * @return The supplied account id.
     */
    public Integer getId() {
        return id;
    }

    /**
     * Supply the account id.
     * @param idParam The supplied account id.
     */
    public void setId(final Integer idParam) {
        this.id = idParam;
    }

    /**
     * Return the supplied account name.
     * @return The supplied account name.
     */
    public String getName() {
        return name;
    }

    /**
     * Supply the account name.
     * @param nameParam The supplied account name.
     */
    public void setName(final String nameParam) {
        this.name = nameParam;
    }

    public AvatarVO getAvatar() {
        return avatar;
    }

    public void setAvatar(AvatarVO avatar) {
        this.avatar = avatar;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(final Object obj) {
        if (obj != null && obj instanceof AccountVO) {
            return ((AccountVO) obj).getId().equals(id);
        } else {
            return false;
        }
    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        return id;
    }

}
